/**
 * Copyright (C), 2012-2018, 联奕科技有限公司
 * FileName: ImageCode
 * Author:   石贵武
 * Date:     2018\3\9 0009 9:43
 * Description: 生成图片认证码
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhoudongxiu.security.core.vaildators.code;

import lombok.Data;

import java.awt.image.BufferedImage;
import java.time.LocalDateTime;

/**
 * 〈一句话功能简述〉<br>
 * 〈生成图片认证码〉
 *
 * @author 石贵武
 * @create 2018\3\9 0009
 * @since 1.0.0
 */
@Data
public class ImageCode  extends ValidateCode {

    private BufferedImage image;


    public ImageCode(BufferedImage image, String code, int expireInt) {
        super(code, expireInt);
        this.image = image;


    }
    public ImageCode(BufferedImage image, String code, LocalDateTime expireTime) {
        super(code, expireTime);
        this.image = image;

    }
    public boolean isExpried() {
        return LocalDateTime.now().isAfter(super.getExpireTime());
    }

}